<style>
	#ui-datepicker-div.ui-widget-content{background: #fff;border: 1px solid gray;}
	table{text-align: left;width: 100%;}
	table tr th{background-color: #eeeeee;}
	table tr td,table tr th{border: 1px solid #d3d2d2;padding: 10px;}
	table input{width: 80px;height: 20px;}
	
	table label{display: inline-block;cursor: default;margin: 0 3px;}
	table input[type="checkbox"],table input[type="radio"]{margin: 0;cursor: default;margin-top: -2px;}
	table .thSetPrice a{
		display: block;margin: 5px 0;padding: 3px 5px;border: 1px solid #888888;background-color: #888888;
		color: #fff;text-decoration: none;text-align: center;width: 60px;cursor: pointer;
	}
	table a:hover{text-decoration: none;background-color: #368ee0;border-color: #368ee0;}
	
	.page{padding: 5px;border: 2px solid #368ee0;border-top: none;}
	.page .page_count{padding-top: 5px;}
	.page .page_count label{display: inline-block;line-height: 30px;font-weight: normal;float: left;}
	.page .page_count .paginate_button{
		margin: 0 5px;
		float: left;
		background-color: #D5D5D5;
		padding: 5px 12px;
		color: #7d7d7d;
		border-radius: 3px;
	}
	.page .page_count .paginate_button:hover{
		background-color: #89affc;
		color: #fff;
	}
	.page .page_count .paginate_active{
		margin: 0 5px;
		float: left;
		padding: 5px 12px;
		color: #fff;
		background-color: #89affc;
		border-radius: 3px;
	}
	.page a{text-decoration: none;}
	.page b{color: #FF4500;}
	
	.box-title a{float: right;border: 1px solid #5bc0de;background: #5bc0de;color: #fff;padding: 3px 8px;border-radius: 3px;margin-right: 10px;}
	table.th_table tbody tr:hover{background-color: #D9D9D9;}
	input.datepickerinput,select{width: 100px;margin-top: 5px;}
	.ui-datepicker-trigger{display: none;}
</style>
<div id="main">
    <div class="container-fluid">
        <div class="page-header">
        	<div class="pull-left">
        		<h1>订单列表管理</h1>
        	</div>
        	<div class="pull-right">
        		<ul class="stats">
        			<li class='lightred'>
        				<i class="icon-calendar"></i>
        				<div class="details">
        					<span class="big"></span>
        					<span></span>
        				</div>
        			</li>
        		</ul>
        	</div>
        </div>
        <div class="breadcrumbs">
        	<ul>
        		<li>
        			<a href="javascript:void(0);">后台管理</a>
        			<i class="icon-angle-right"></i>
        		</li>
        		<li>
        			<a href="javascript:void(0);">订单列表管理</a>
        			<i class="icon-angle-right"></i>
        		</li>
        		<li>
        			<a href="javascript:void(0);">订单列表</a>
        		</li>
        	</ul>
        	<div class="close-bread">
        		<a href="#"><i class="icon-remove"></i></a>
        	</div>
        </div>
        <div class="row-fluid">
        	<div class="span12">
        		<div class="box box-color box-bordered">
        			<div class="box-title">
        				<h3>
        					<i class="icon-th-list"></i>
        					订单列表
        				</h3>
                        <a href="<?=$this->url('mySetPrice/exportOrder?nameKey='.$nameKey.'&sta='.$sta.'&end='.$end.'&qudao='.$qudao.'&payType='.$payType)?>">导出订单列表</a>
        			</div>
                    <link rel="stylesheet" href="/public/assets/sysadmin/mylzp/css/jquery-ui.css">
                    <script type="text/javascript" src="/public/assets/sysadmin/mylzp/js/jquery-ui.js"></script>
                    <div style="border: 2px solid #368ee0;border-top: none;border-bottom: none;padding: 10px;">
                        <form action="" method="get" style="margin: 0;padding: 0;">
                            关键字 <input type="text" name="nameKey" value="<?=$nameKey?>" placeholder="订单号,酒店名称,房型名称(多个用半角逗号分开)" style="margin-top: 5px;width: 300px;" />
                            &nbsp;&nbsp;&nbsp;离店时间 <input type="text" name="sta" value="<?=$sta?>" placeholder="开始时间" class="datepickerinput" readonly="" />
                            - <input type="text" name="end" value="<?=$end?>" class="datepickerinput" placeholder="结束时间" readonly="" />
                            &nbsp;&nbsp;&nbsp;渠  道 <select name="qudao" style="width: 100px;">
                                <option value="0">全部</option>
                                <?
                                if($channels){
                                    foreach($channels as $k=>$v){?>
                                        <option value="<?=$v['osiiId']?>" <?=$qudao==$v['osiiId']?'selected':''?> ><?=$v['title']?></option>
                                    <?}
                                }
                                ?>
                            </select>
                            &nbsp;&nbsp;&nbsp;支付类型 <select name="payType">
                                <option value="0">全部</option>
                                <?
                                if($pmsconfigs['payType']){
                                    foreach($pmsconfigs['payType'] as $k=>$v){?>
                                        <option value="<?=$k?>" <?=$payType&&$payType==$k?'selected':''?> ><?=$v?></option>
                                    <?}
                                }
                                ?>
                            </select>
                            &nbsp;&nbsp;&nbsp;<button style="border: 1px solid transparent;background-color: #368ee0;color: #fff;padding: 3px 8px;margin-top: -5px;">查询</button>
                            <a href="<?=$this->url('mySetPrice/orders')?>" style="color: red;margin-left: 10px;">显示全部</a>
                        </form>
                    </div>
                    <div style="border: 2px solid #368ee0;border-top: none;<?=$number>1?'border-bottom: none;':''?>">
                        <table class="th_table">
        					<thead>
        						<tr>
        							<th>订单号</th>
        							<th>酒店名称</th>
        							<th>房型名称</th>
        							<th>预订间数</th>
        							<th>预订天数</th>
        							<th>预订来源</th>
        							<th>订单客户</th>
        							<th>入住时间</th>
        							<th>离店时间</th>
        							<th>结算总价(元)</th>
        							<th>支付类型</th>
        							<th>订单状态</th>
        							<th>下单时间</th>
        						</tr>
        					</thead>
                            <tbody>
                                <?
                                if($re){
                                    foreach($re as $k=>$v){?>
                                        <tr>
                                            <td><?=$v['orderId']?></td>
                							<td><?=$v['hotelName']?></td>
                							<td><?=$v['title']?></td>
                                            <td><?=$v['countRoom']?></td>
                                            <td><?=($v['endDate']-$v['startDate'])/3600/24?></td>
                                            <td><?=$v['sourceName']?></td>
                							<td><?=$v['name']?></td>
                							<td><?=date('Y-m-d',$v['startDate'])?></td>
                							<td><?=date('Y-m-d',$v['endDate'])?></td>
                							<td><?=$v['payType']=='PP'?$v['price']:$v['price']-$v['floatPrice']-$v['hotelPrice']?></td>
                                            <td><?=$pmsconfigs['payType'][$v['payType']]?></td>
                							<td style="color: green;"><?=$pmsconfigs['orderstatus'][$v['status']]?></td>
                							<td><?=date('Y-m-d H:i:s',$v['created'])?></td>
                						</tr>
                                    <?}
                                }else{?>
                                    <tr><td colspan="13" style="text-align: center;font-size: 20px;">没有相关记录</td></tr>
                                <?}?>
                            </tbody>
        				</table>
                    </div>
					<?if($re&&$number>1){?><div class="page"><?=$pageHtml?></div><?}?>
                </div>
        	</div>
        </div>
    </div>
</div>
<script type="text/javascript">
$(function() {
	$(".datepickerinput").datepicker({
        minDate: '',
        showMonthAfterYear: true,
        changeMonth: true,
        numberOfMonths: 1,
        showOn: "both",
        showButtonPanel:true,
        duration: 100,
        onSelect: function( selectedDate ) {
            $('input[name="end"]').datepicker( "option", "minDate", selectedDate );
        }
    });
    $('.ui-datepicker-trigger').remove();
});
</script>